{extend name="public/base" /} {block name="body"}
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('web/index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li><strong>商家联盟列表</strong></li>
	</ol>
</div>
<div class="ibox float-e-margins">
	<div class="ibox-content">
		{if $count == 0 && $list2 ==0 }
		<div class="row">
			<div class="col-sm-12">
				<div class="col-sm-2">
					<div class="input-group">
						<a href="{:url('add')}" class="btn btn-xs btn-primary">发起联盟</a>
					</div>
				</div>
			</div>
		</div>
		{/if}{if $count != 0 }
		<div class="row">
			<div class="col-sm-12">
				<div class="col-sm-2">
					<div class="input-group">
						<a href="{:url('audit')}" class="btn btn-xs btn-primary">查看申请（{$p}）</a>
					</div>
				</div>
			</div>
		</div>
		{/if}
            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        {if $list}
                        <thead>
                            <tr class="long-tr">
                                <th class="text-center">id</th>
                                <th class="text-center">logo</th>
                                <th class="text-center">名称</th>
                                <th class="text-center">地址</th>
                                <th class="text-center">电话</th>
                                <th class="text-center">负责人</th>
                                <th class="text-center">状态</th>
								<th class="text-center">排序</th>
                                <th class="text-center">操作</th>
                            </tr>
                        </thead>
                        <tbody id="list">
                        	{volist name="list" id='ad'}
                        	<tr>
                        		<td class="text-center">{$ad.id}</td>
                        		<td class="text-center"><img src="{$ad.thumb}"  width="50px"/></td>
                        		<td class="text-center">{$ad.name}</td>
                        		<td class="text-center">{$ad.address}</td>                       		
                        		<td class="text-center">{$ad.store_tel}</td>
                        		<td class="text-center">{$ad.shopowner}</td>
                        		<td class="text-center">
                        			{if $ad.status == 1}
                        			审核中
                        			{elseif $ad.status == 2}
                        			审核通过
                        			{else}
                        			审核不通过
                        			{/if}
                        		</td>
                        		<td class="text-center">{$ad.sort}</td>
                        		<td class="text-center">	
                        			<a href="{:url('site',['id'=>$ad.id])}" class="btn btn-primary bnt-sm">
										<i class="fa fa-paste"></i> 编辑</a>
										&nbsp;&nbsp; {if $ad.status==2}
									<a href="{:url('member',['id'=>$ad.id])}" class="btn btn-primary bnt-sm">
										<i class="fa fa-user"></i> 成员列表</a>&nbsp;&nbsp;{/if}
									<a href="{:url('delete',['id'=>$ad.id])}" class="btn btn-danger bnt-sm ajax-delete">
										<i class="fa fa-trash-o"></i> 删除</a>
									
                        		</td>
                        	</tr>
                        	{/volist}
                        </tbody>
                        {/if}
                        {if $list1}
                        <thead>
                            <tr class="long-tr">
                                <th class="text-center">id</th>
                                <th class="text-center">logo</th>
                                <th class="text-center">名称</th>
                                <th class="text-center">地址</th>
                                <th class="text-center">电话</th>
                                <th class="text-center">负责人</th>
                                <th class="text-center">状态</th>
								<th class="text-center">排序</th>
                                <th class="text-center">操作</th>
                            </tr>
                        </thead>
                        <tbody id="list">
                        	{volist name="list1" id='ad'}
                        	<tr>
                        		<td class="text-center">{$ad.id}</td>
                        		<td class="text-center"><img src="{$ad.thumb}"  width="50px"/></td>
                        		<td class="text-center">{$ad.name}</td>
                        		<td class="text-center">{$ad.address}</td>                       		
                        		<td class="text-center">{$ad.store_tel}</td>
                        		<td class="text-center">{$ad.shopowner}</td>
                        		<td class="text-center">
                        			{if $ad.status == 1}
                        			审核中
                        			{elseif $ad.status == 2}
                        			审核通过
                        			{else}
                        			审核不通过
                        			{/if}
                        		</td>
                        		<td class="text-center">{$ad.sort}</td>
                        		<td class="text-center">	
                        			<a href="{:url('apply',['union_id'=>$ad.id])}" class="btn btn-primary bnt-sm">
										<i class="fa fa-paste"></i>申请加入联盟</a>
										&nbsp;&nbsp; {if $ad.status==2}
									<a href="{:url('member',['id'=>$ad.id])}" class="btn btn-primary bnt-sm">
										<i class="fa fa-user"></i> 成员列表</a>&nbsp;&nbsp;{/if}
	
                        		</td>
                        	</tr>
                        	{/volist}
                        </tbody>
                        {/if}
                        {if $list2}
                        <thead>
                            <tr class="long-tr">
                            	<th class="text-center">名称</th>
                                <th class="text-center">logo</th>
                                <th class="text-center">地址</th>
                                <th class="text-center">负责人</th>
                                <th class="text-center">电话</th>
                                <th class="text-center">申请时间</th>
                                <th class="text-center">加入时间</th>
                                <th class="text-center">操作</th>
                            </tr>
                        </thead>
                        <tbody id="list">
                        	
                        	<tr>
                        		<td class="text-center">{$list2.name}</td>
                        		<td class="text-center"><img src="{$list2.thumb}"  width="50px"/></td>
                        		<td class="text-center">{$list2.address}</td> 
                        		<td class="text-center">{$list2.shopowner}</td>                       		
                        		<td class="text-center">{$list2.store_tel}</td>
                        		<td class="text-center">{$list2.time}</td>
                        		<td class="text-center">{$list2.jia_time}</td>
                        		<td class="text-center">	
                        			{if $list2.state==0}
                        			<a href="#" class="btn btn-primary bnt-sm">
										<i class="fa fa-paste"></i>申请中</a>{/if}
										&nbsp;&nbsp; 
									<a href="{:url('member',['id'=>$list2.id])}" class="btn btn-primary bnt-sm">
										<i class="fa fa-user"></i> 成员列表</a>&nbsp;&nbsp;
									{if $list2.state==0}
                        			<a href="{:url('quit',['id'=>$list2.id])}" class="btn btn-primary bnt-sm">
										<i  class="fa fa-trash-o"></i>取消申请</a>{/if}
										{if $list2.state==1}
                        			<a href="{:url('quit',['id'=>$list2.id])}"  class="btn btn-primary bnt-sm">
										<i  class="fa fa-trash-o"></i>退出联盟</a>{/if}
                        		</td>
                        	</tr>
                        
                        </tbody>
                        {/if}
                    </table>
                    <div style="color: #337ab7">
                  		备注：只能发起1个或者加入一个联盟
                    </div>
                    <div style="text-align: right;">

                    </div>
                </div>
            </div>
            </div>
</div>
{/block} {block name="script"}
<script>
</script>
{/block}